#url   问号后面是参数
import requests
url = "https://movie.douban.com/j/chart/top_list"
#重新封装参数
#https://movie.douban.com/j/chart/top_list?type=17&interval_id=100%3A90&action=&start=0&limit=20
dic={
    "User-Agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36 Edg/126.0.0.0"
}
pram={
    "type":"24",
    "interval_id" :"100:90",
    "action":"",
    "start":0,
    "limit":20,
}
resp = requests.get(url=url, params=pram, headers=dic)#获取响应
# print(resp.request.url)
#爬虫被反爬  尝试ua

#print(resp.request.headers) 查看py默认ua
print(resp.json())

